<template>
  <ul class="footer">
    <li @click="goTo('/index')">
      <i class="fa fa-home"></i>
      <p>首页</p>
    </li>
    <li>
      <i class="fa fa-compass"></i>
      <p>发现</p>
    </li>
    <li @click="goTo('/orders')">
      <i class="fa fa-file-text-o"></i>
      <p>订单</p>
    </li>
    <li @click="goTo('/login')">
      <i class="fa fa-user-o"></i>
      <p>我的</p>
    </li>
  </ul>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useRouter } from 'vue-router'

export default defineComponent({
  name: 'Footer',
  setup() {
    const router = useRouter()
    const goTo = (path: string) => router.push(path)
    return { goTo }
  }
})
</script>

<style scoped>
.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 14vw;
  background-color: #FFF;
  border-top: 0.2vw solid #E5E5E5;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.footer li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #999;
  cursor: pointer;
}

.footer li i {
  font-size: 5vw;
  margin-bottom: 1vw;
}

.footer li p {
  font-size: 2.8vw;
}
</style>